package cn.topevery.garden.dal.logic;

import cn.topevery.garden.dal.dao.MachineInfoDao;
import cn.topevery.garden.entity.dto.MachineInfoDTO;
import cn.topevery.garden.entity.po.MachineInfo;
import cn.topevery.garden.entity.po.MachineInfo;
import cn.topevery.garden.entity.query.MachineInfoQuery;
import cn.topevery.garden.entity.vo.MachineInfoVO;

import hw.topevery.framework.db.entity.DataPager;
import hw.topevery.framework.db.base.BaseEntityDao;
import cn.topevery.garden.framework.base.BaseLogic;
import hw.topevery.framework.db.base.BaseEntityDao;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.UUID;

/**
 * 机械信息
 */
@Service
public class MachineInfoLogic extends BaseLogic<MachineInfo> {
    @Autowired
    MachineInfoDao machineInfoDao;

    @Override
    public BaseEntityDao<MachineInfo, Integer> getDao() {
        return machineInfoDao;
    }

    

    /**
     * 获取列表
     *
     * @param query
     */
    public DataPager<MachineInfoVO> listPage(MachineInfoQuery query) {
        return machineInfoDao.listPage(query);
    }

    /**
     * 根据自增id批量删除
     *
     * @param ids
     */
    public void deleteBatchById(String userId,Integer[] ids) {
        machineInfoDao.delete(userId, ids);
    }

    /**
     * 根据自增id保存或者更新
     *
     * @param machineInfo 实体
     */
    public void saveOrUpdate(String userId, MachineInfo machineInfo){
        machineInfoDao.saveOrUpdate(userId,machineInfo);
    }

    /**
         * 根据自定义列值来获取对象
         */
    public MachineInfo getEntityByColumn(String key, String value) {
        return machineInfoDao.getEntityByColumn(key, value);
    }
}
